package ru.spbau.database.group3;


import ru.spbau.database.group3.queryEvaluator.QueryEvaluator;

import java.io.*;
import java.nio.file.Files;
import java.nio.file.Paths;


public class Main {

    public static void main(String [] args) throws ClassNotFoundException, IOException {
        if(args.length != 1 || !Files.exists(Paths.get(args[0]))) {
            System.out.println("Usage: ./dbms path/to/database/dir/");
        }
        connectToDatabase(args[0]);
        runEngine();
    }

    private static void runEngine() throws IOException, ClassNotFoundException {
        QE.start();
    }

    private static void connectToDatabase(String path) throws IOException, ClassNotFoundException {
        QE = new QueryEvaluator(path);
    }

    private static QueryEvaluator QE;


}
